﻿//
//  HFBaseHTTPRequestManager.h
//  Pods
//
//  Created by admin on 2020/4/10.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@class AFHTTPRequestSerializer;
@protocol AFURLRequestSerialization;
@protocol AFMultipartFormData;

@interface HFBaseHTTPRequestManager : NSObject

@property (class, nonatomic, strong, readonly) HFBaseHTTPRequestManager *manager;
/// 蓝知专用
@property (nonatomic, strong, readonly) AFHTTPRequestSerializer<AFURLRequestSerialization> *htRequestSerializer;
/// 来聚财专用
@property (nonatomic, strong, readonly) AFHTTPRequestSerializer<AFURLRequestSerialization> *ljcRequestSerializer;
/// 来聚财请求头带sign专用
@property (nonatomic, strong, readonly) AFHTTPRequestSerializer<AFURLRequestSerialization> *ljcSignRequestSerializer;
/// 基础链接
@property (nonatomic, copy) NSDictionary *baseURLDictionary;
/// 基础参数
@property (nonatomic, copy) NSDictionary *baseParameters;
/// 是否开启报文加密
@property (nonatomic, assign) BOOL signEnabled;

+ (NSURLSessionDataTask *)HTPOST:(NSString *)URLString
                      parameters:(id)parameters
                         success:(void(^)(NSURLSessionDataTask *task, id responseObject))success
                         failure:(void(^)(NSURLSessionDataTask *task, NSError *error))failure;

+ (NSURLSessionDataTask *)LJCPOST:(NSString *)URLString
                       parameters:(id)parameters
                          success:(void(^)(NSURLSessionDataTask *task, id responseObject))success
                          failure:(void(^)(NSURLSessionDataTask *task, NSError *error))failure;

+ (NSURLSessionDataTask *)LJCSignPOST:(NSString *)URLString
                           parameters:(id)parameters
                              success:(void(^)(NSURLSessionDataTask *task, id responseObject))success
                              failure:(void(^)(NSURLSessionDataTask *task, NSError *error))failure;

+ (NSURLSessionDataTask *)HTGET:(NSString *)URLString
                     parameters:(id)parameters
                        success:(void(^)(NSURLSessionDataTask *task, id responseObject))success
                        failure:(void(^)(NSURLSessionDataTask *task, NSError *error))failure;

+ (NSURLSessionDataTask *)LJCGET:(NSString *)URLString
                      parameters:(id)parameters
                         success:(void(^)(NSURLSessionDataTask *task, id responseObject))success
                         failure:(void(^)(NSURLSessionDataTask *task, NSError *error))failure;

+ (NSURLSessionDataTask *)HTPOST:(NSString *)URLString
                      parameters:(id)parameters
       constructingBodyWithBlock:(void(^)(id <AFMultipartFormData> formData))block
                        progress:(void(^)(NSProgress *uploadProgress))uploadProgress
                         success:(void(^)(NSURLSessionDataTask *task, id responseObject))success
                         failure:(void(^)(NSURLSessionDataTask *task, NSError *error))failure;

+ (NSURLSessionDataTask *)LJCPOST:(NSString *)URLString
                       parameters:(id)parameters
        constructingBodyWithBlock:(void(^)(id <AFMultipartFormData> formData))block
                         progress:(void(^)(NSProgress *uploadProgress))uploadProgress
                          success:(void(^)(NSURLSessionDataTask *task, id responseObject))success
                          failure:(void(^)(NSURLSessionDataTask *task, NSError *error))failure;

+ (void)setValue:(NSString *)value forHTTPHeaderField:(NSString *)field;

@end

NS_ASSUME_NONNULL_END

